from aiogram import types
from aiogram.filters.callback_data import CallbackData
from aiogram_dialog import DialogManager

from poker_bot.tg_bot.services.tg_helpers import delete_msg
from poker_bot.tg_bot.states import AccountDetailsSG


async def go_to_account_handler(
    call: types.CallbackQuery,
    callback_data: CallbackData,
    dialog_manager: DialogManager,
):
    await delete_msg(call.message)
    await dialog_manager.start(
        AccountDetailsSG.account_details,
        data={"account_id": callback_data.account_id},
    )
